home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / 1.2 / scripts / basic1-logo.scm.z / basic1-logo.scm
Text File  |  2002-07-08  |  3KB  |  81 lines

  1. ;  DROP-SHADOW-LOGO
  2. ;  draw the specified text over a background with a drop shadow
  3.  
  4. (define (apply-basic1-logo-effect img
  5.                   logo-layer
  6.                   bg-color
  7.                   text-color)
  8.   (let* ((width (car (gimp-drawable-width logo-layer)))
  9.      (height (car (gimp-drawable-height logo-layer)))
  10.      (bg-layer (car (gimp-layer-new img width height RGBA_IMAGE "Background" 100 NORMAL)))
  11.      (shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 MULTIPLY)))
  12.      (old-fg (car (gimp-palette-get-foreground)))
  13.      (old-bg (car (gimp-palette-get-background))))
  14.     (gimp-image-resize img width height 0 0)
  15.     (gimp-image-add-layer img shadow-layer 1)
  16.     (gimp-image-add-layer img bg-layer 2)
  17.     (gimp-palette-set-foreground text-color)
  18.     (gimp-layer-set-preserve-trans logo-layer TRUE)
  19.     (gimp-edit-fill logo-layer FG-IMAGE-FILL)
  20.     (gimp-palette-set-background bg-color)
  21.     (gimp-edit-fill bg-layer BG-IMAGE-FILL)
  22.     (gimp-edit-clear shadow-layer)
  23.     (gimp-selection-layer-alpha logo-layer)
  24.     (gimp-palette-set-background '(0 0 0))
  25.     (gimp-selection-feather img 7.5)
  26.     (gimp-edit-fill shadow-layer BG-IMAGE-FILL)
  27.     (gimp-selection-none img)
  28.     (gimp-palette-set-foreground '(255 255 255))
  29.     (gimp-blend logo-layer FG-BG-RGB MULTIPLY RADIAL 100 20 REPEAT-NONE FALSE 0 0 0 0 width height)
  30.     (gimp-layer-translate shadow-layer 3 3)
  31.     (gimp-palette-set-background old-bg)
  32.     (gimp-palette-set-foreground old-fg)))
  33.  
  34. (define (script-fu-basic1-logo-alpha img
  35.                      logo-layer
  36.                      bg-color
  37.                      text-color)
  38.   (begin
  39.     (gimp-undo-push-group-start img)
  40.     (apply-basic1-logo-effect img logo-layer bg-color text-color)
  41.     (gimp-undo-push-group-end img)
  42.     (gimp-displays-flush)))
  43.  
  44. (script-fu-register "script-fu-basic1-logo-alpha"
  45.             _"<Image>/Script-Fu/Alpha to Logo/Basic I..."
  46.             "Creates a simple logo with a drop shadow"
  47.             "Spencer Kimball"
  48.             "Spencer Kimball"
  49.             "1996"
  50.             "RGBA"
  51.                     SF-IMAGE      "Image" 0
  52.                     SF-DRAWABLE   "Drawable" 0
  53.             SF-COLOR      _"Background Color" '(255 255 255)
  54.             SF-COLOR      _"Text Color" '(6 6 206))
  55.  
  56. (define (script-fu-basic1-logo text
  57.                    size
  58.                    font
  59.                    bg-color
  60.                    text-color)
  61.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  62.      (text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))))
  63.     (gimp-image-undo-disable img)
  64.     (gimp-layer-set-name text-layer text)
  65.     (apply-basic1-logo-effect img text-layer bg-color text-color)
  66.     (gimp-image-undo-enable img)
  67.     (gimp-display-new img)))
  68.  
  69. (script-fu-register "script-fu-basic1-logo"
  70.             _"<Toolbox>/Xtns/Script-Fu/Logos/Basic I..."
  71.             "Creates a simple logo with a drop shadow"
  72.             "Spencer Kimball"
  73.             "Spencer Kimball"
  74.             "1996"
  75.             ""
  76.             SF-STRING     _"Text" "The Gimp"
  77.             SF-ADJUSTMENT _"Font Size (pixels)" '(100 2 1000 1 10 0 1)
  78.             SF-FONT       _"Font" "-*-Dragonwick-*-r-*-*-24-*-*-*-p-*-*-*"
  79.             SF-COLOR      _"Background Color" '(255 255 255)
  80.             SF-COLOR      _"Text Color" '(6 6 206))
  81.